import Vue from 'vue'
import './cube-ui'
import App from './App.vue'
import router from './router'
import store from './store'
import 'swiper/css/swiper.min.css'
import './theme/style.styl'
Vue.config.productionTip = false;

// vant
import Vant from 'vant';
import 'vant/lib/index.css';

Vue.use(Vant);

// echarts
const ECharts =require('echarts')
Vue.prototype.$echarts = ECharts;


window.onresize = setHtmlFontSize
function setHtmlFontSize () {
  const htmlWidth = document.documentElement.clientWidth || document.body.clientWidth
  const htmlDom = document.getElementsByTagName('html')[0]
  htmlDom.style.fontSize = htmlWidth / 10 + 'px'
}

Vue.filter('formatCard', function (val) {
  if (!val) return ''
  var reg = /^(\d{4})\d{4}(\d.*)$/;
  val = val.replace(reg, '$1****$2');
  return val;
})


setHtmlFontSize()
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
